home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group97a.txt
/
000113_icon-group-sender _Sat Apr 12 17:10:21 1997.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 14 Apr 1997 09:15:33 MST
Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
id AA02722; Mon, 14 Apr 1997 09:15:32 -0700
To: icon-group@cs.arizona.edu
Date: Sat, 12 Apr 1997 17:10:21 +1000
From: Stuart.Robinson@anu.edu.au (Stuart Robinson)
Message-Id: <Stuart.Robinson-1204971710220001@asianstmg-203.anu.edu.au>
Organization: ANU
Sender: icon-group-request@cs.arizona.edu
Subject: More on Records
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 940
Suppose you want to scan through each line of a text looking for a
particular type of word. Roughly speaking, the first time you find it, it
should go to one field of a record and the second time you find it, it
should go to another field of the same record. (The word will appear at
most two times in a line, possibly not at all.) How would you do it?
More concretely, if you have the following line
{T.p istam eCel 3{O stuK 1{A
and a record with four fields like the following
record[index1, arg1, index2, arg2]
how do you write code that would take the first word with "{" followed by
"S", "A", or "O" and put it into arg1 and its accompanying number into
index1 and then take the second word in the same line with "{" followed by
"S", "A", or "O" and put it into arg2 and its accompanying number into
index2, as below?
record[3, {O, 1, {A]
--
Stuart Robinson <Stuart.Robinson@anu.edu.au>
The Australian National University